home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
comm
/
cs_mac06.zip
/
ACTION.MAC
next >
Wrap
Text File
|
1992-08-23
|
10KB
|
223 lines
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC06:ACTION.MAC
└────────────────────────────────┘
┌──────────────────────────────────┐
┌───┤ COMMO "ACTION processor" macro ├───
└──────────────────────────────────┘
* ACTION.MAC reads simple ASCII files and sends commands and
* strings to the BBS based on the ACTION file. Setup for PCBoards.
* You may make an ACTION file manually with a text editor.
* An ACTION file generator is included later as the :alf macro command.
* Located in the COMMO home dir, the ACTION file has this sort of format:
┌─────────────────────────────── action.nl ─┐
│ u │ < "U" for upload
│ filename.ul │ < Name the file to u/l
│ A line of file desription. Up to 45 chars │ < decription
│ in length. Multiple line descriptions are │
│ supported if your BBS host allows them. │
│ -- │ < "--" to end ACTION item
│ d │ < "D" for download
│ file1.dl │ < batch downloads allowed
│ another.zip │
│ filemore.lhz │
│ -- │ < "--" is important
│ u │
│ another.zip │
│ /Private to the sysop. Thanks for the fish │
│ -- │ < Esp. at the very end.
└─────────────────────────────────────────────┘
{:action}{sete-P0 esc}
{rope %_hom%action.%abbr,act-end} <- START here
{:reread}{pops-c}
{setl 60,,10,|}
{read cmd} ;read line of ACTION file
{comp cmd,--} {ifco reread} ;branch to appropriate ACTION
{comp cmd,a} {ifco asciup}
{comp cmd,j} {ifco joincn}
{comp cmd,d} {ifco dlfile}
{comp cmd,u} {ifco ulfile} ;if no match, end ACTION
{:act-end} ;When at end of ACTION list
{exec-n echo ^j*-*-* %_dat %_tim >> %savdir\used-act.%abbr}
{exec-n type %_hom%action.%abbr >> %savdir\used-act.%abbr}
{exec-n del %_hom%action.%abbr}
{setv line} {setv fname} {setv cmd}
{:esc} {macl logon.mac,noact} <- END here
{:dlfile}{send %cmd%|} ;Setup is for Zmodem BATCH downloads
{golo skip,not avai} ;If host doesn't allow d/l, skip it
{:next-d}{read fname} ;Read one complete line into %fname%
{inst fname,--} {ifco do-dl}
{ifex %dldir\%fname,next-d} ;Don't try to d/l files that exist
{send %fname%~~~|} ;Send filename to BBS
{goto next-d} ;Repeat read til dl-list is all read
{:do-dl} {send |~~|} ;Start download
{push}
{golo reread,%bbs_pmt} ;if no filenames matched
{golo n|,ed? [} ;Wildcat logoff after transfer
{golo z|,] ? [} ;Wildcat protocol select
{look ^xB00}
{pops}
{exec-n %dszprog port %_por ha bo rz -mr %dldir}
{golo reread,] ? [} ;At Wildcat File Menu
{look %bbs_pmt}
{goto reread} ;end of "D" ACTION processor
{:ulfile}{read fname} ;Upload ACTION starts
{ifex %uldir\%fname,,skip} ;Make sure file exists on your disk
{send u %fname% z|} ;Tell host to get ready for u/l
{golo skip,Insufficient} ; disk space for complete upload!
{golo skip,not avai} ;If host doesn't allow u/l, or
{golo skip,y exists} ;If host says file already exists,
{golo skip,plicates} ; skip this u/l action item.
{look ximum)} ;Host is ready for description.
{:desc} {read line}
{comp line,--} ;Check for end of u/l action
{ifco ul_ok}
{send ~%line%|} ;Send description line
{goto desc} ;and look for more description
{:ul_ok} {send ~|}
{look ^xB01} ;Zmodem upload
{exec-n %dszprog port %_por ha bo sz -m %uldir\%fname}
{setl 60,,30,|} ;Allow time for file validation
{look %bbs_pmt}
{goto reread} ;end of "U" ACTION processor
{:skip} {read line} ;SKIP section jumps to next
{comp line,--} ; action item by reading to
{ifco ,skip} ; the next "--" string.
{send |}
{setl 50,,3,|}
{look %bbs_pmt}
{goto reread} ;alternate end of "U" processor
* ASCII uploads take a special form. Here is an example message.
* You may need to structure ASCII upload messages differently.
┌────────────────────────────────── hijack ──┐
│ jack kilday │ < Message Recipient
│ Thanks for the Fish │ < Message Subject
│ n │ < Public/Private msg flag
│ u │ < Use ASCII u/l, not editor
│ Hi Jack, │
│ │
│ Just stopping in with a test of a COMMO │
│ ACTION macro processor. I also wanted to │
│ give you a big THANK YOU for all the fish. │
│ They were delicious. │
│ │
│ Chuck·S │
└─────────────────────────────────────────────┘
{:asciup}{read fname} ;ASCII upload to PCBoard system
{ifex %dldir\%fname%,,reread}
{parm ,,,,2} {send e|} ;Send "E" to start message entry
{asci %dldir\%fname%,} ;Send the structured message
{parm ,,,,0} {send ~~|~~~sn|} ;the PCBoard "save" command
{look %bbs_pmt}
{goto reread} ;end of "A" processor
{:joincn}{read fname} ;Join PCBoard Conference
{send j %fname|}
{push}
{golo n|,)=yes?} ;Skip mail scan
{golo |,invalid} ;If you choose invalid conf
{golo n|,(H)elp} ;If you chose invalid conf
{golo 0|,none?} ;To conf 0 on invalid conf
{look %bbs_pmt} {pops}
{goto reread} ;end of "J" processor
┌───────────────────────────────────┐
└───┤ End Of "ACTION processor" macro ├───────
└───────────────────────────────────┘
┌─────────────────────────────┐
┌───┤ "ACTION generator" macro ├───
└─────────────────────────────┘
* One new feature in version CS-MAC06 ... now using PKUNZIP to
* automatically insert the file description from a DESC.SDI or
* a FILE_ID.DIZ that might be found in a ZIP file.
* This macro isn't commented. It is pretty easy to follow.
* Here it is assigned to the Alt-F key combination.
{:alf} {sete-p0 icmnd}
{inpu abbr,Make ^(ACTION^) file: What BBS?} <- START Here
{comp abbr} {ifco opena}
{subs abbr,1,2,%abbr}
{:opena} {wope %_hom%action.%abbr}
{:icmnd} {setv cmd} {setv fname} {setv line}
{inpu cmd,^(U^)pload, ^(D^)ownload, ^(A^)scii Upload, ^(J^)oin Conf?}
{comp cmd,u} {ifco makeul}
{comp cmd,d} {ifco makedl}
{comp cmd,a} {ifco makeau}
{comp cmd,j} {ifco makejn}
{comp cmd} {ifco ,icmnd}
{wclo} {edit %_hom%action.%abbr}
{setv cmd} {setv fname} {setv line}
{macl commo.mac} <- END Here
{:makejn}{inpu fname,Name or Number of Conference to Join}
{comp fname} {ifco icmnd}
{writ j}
{writ %fname}
{writ --} {goto icmnd}
{:makeau}{inpu fname,Name the ASCII Upload}
{comp fname} {ifco icmnd}
{ifex %dldir\%fname,,makeau}
{writ a}
{writ %fname}
{writ --} {goto icmnd}
{:makedl}{setv fname} {setv count,1}
{inpu fname,Name a File that you want to DownLoad}
{comp fname} {ifco icmnd}
{writ d}
{:dlmore}{writ %fname}
{incr count} {setv fname}
{inpu fname,File #%count% to Download?}
{comp fname} {ifco ,dlmore}
{writ --} {goto icmnd}
{:makeul}{inpu fname,Name the file to upload}
{comp fname} {ifco icmnd}
{ifex %dldir\%fname,descul,makeul}
{:descul}{exec-d %pk_un -v %dldir\%fname desc.sdi file_id.diz}
{ifer 1,,diz_dsc}
{setv count,1}
{setv line}
{inpu line,One line description of %fname% Required}
{comp line} {ifco icmnd}
{writ u} {write %fname}
{writ %line} {incr count}
{:mdesc} {setv line} {inpu line,Line %count% of %fname% description}
{comp line} {ifco endul}
{writ %line} {incr count}
{goto mdesc}
{:endul} {writ --} {goto icmnd}
{:diz_dsc} {writ u} {write %fname}
{setv file,file_id.diz}
{:add_dsc} {exec-d %pk_un -v %uldir\%fname %file}
{ifer 1,chk_sdi}
{exec-n %pk_un -o %uldir\%fname %ramdr\ %file}
{rope %ramdr\%file,endul}
{:diz_lp} {read line}
{writ %line}
{goto diz_lp}
{:chk_sdi} {setv file,desc.sdi}
{goto add_dsc}
┌───────────────────────────────────┐
└───┤ End Of "ACTION generator" macro ├───────
└───────────────────────────────────┘